package com.smart.manager.member.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.enums.FriendRelationState;
import com.smart.manager.member.entities.views.MemberView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.time.LocalDateTime;


/**
 * 会员-好友关系
 *
 * @author Administrator
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class MemberRelationFriend extends BaseLongModel {

    /**
     * 关系发起邀请人
     */
    @ApiModelProperty("关系发起邀请人")
    @ManyToOne
    @JoinColumn(name = "initiator", referencedColumnName = "id")
    private MemberView initiator;


    /**
     * 关系接收人请人
     */
    @ApiModelProperty("关系接收人请人")
    @ManyToOne
    @JoinColumn(name = "receiver", referencedColumnName = "id")
    private MemberView receiver;


    /**
     * 好友状态
     */
    @ApiModelProperty("会员好友关系")
    private FriendRelationState state;

    /**
     * 申请时间
     */
    @ApiModelProperty("申请时间")
    private LocalDateTime applyTime;


    /**
     * 同意时间
     */

    @ApiModelProperty("同意时间")
    private LocalDateTime finishTime;



    /**
     * 是否存在合养关系
     */
    @ApiModelProperty("是否存在合养关系")
    private Boolean partner;

    /**
     * 关系TOKEN
     */
    @ApiModelProperty("关系TOKEN")
    private String token;


}
